package cn.cn.banking;

import javafx.scene.transform.Scale;

import java.util.Scanner;

public class Account {
    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    private double balance;

public Account(){
    this.balance=1000;


}
public void geBalance(){
    System.out.println("当前余额："+this.balance);
}
public void deposit(){
    int money=0;
    Scanner sc=new Scanner(System.in);
    System.out.print("请输入你要存入的金额：");
    money=sc.nextInt();
    System.out.println("存入成功！当前余额为："+(this.balance+money));

}
public void withdraw(){
    int money;
    Scanner sc=new Scanner(System.in);
    System.out.print("请输入你要取出的金额：");
    money=sc.nextInt();
    if(this.balance<money){
        System.out.println("您的余额不足！");
    }
    else{
        System.out.print("取款成功！当前余额剩："+(this.balance-money));
    }
}
}
